/**
 * dialog 内容高度自动计算指令
 * <div v-dialog-autoheight></div>
 */
const cultFunc = function(el, binding, vnode) {
    const elDialog = el;
    if (binding.value && binding.value !== false && el.offsetParent) {
        // setTimeout(() => {
        const clientHeight = document.documentElement.clientHeight;
        // 浏览器宽度-header-footer-空白
        let maxHeight =
            clientHeight // 浏览器宽度
            - 54 // header
            - 67 // footer
            - 50 // 底部空白
            // - el.offsetParent.offsetTop // 顶部
            + 'px';
        elDialog.style.maxHeight = maxHeight;
        elDialog.style.overflow = 'auto';
        // }, 200);
    }
};
export default {
    inserted: cultFunc,
    //update: cultFunc
};
